﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace WebIG.Data
{
    public class Feed
    {
        [JsonProperty("location")]
        public Location Location { get; set; }

        [JsonProperty("comments")]
        public Comments Comments { get; set; }

        [JsonProperty("caption")]
        public Caption Caption { get; set; }

        [JsonProperty("link")]
        public string Link { get; set; }

        [JsonProperty("likes")]
        public Likes Likes { get; set; }

        [JsonProperty("user_has_liked")]
        public bool UserHasLiked { get; set; }

        [JsonProperty("created_time")]
        public string CreatedTime { get; set; }

        [JsonProperty("images")]
        public Images Images { get; set; }

        [JsonProperty("type")]
        public string Type { get; set; }

        [JsonProperty("users_in_photo")]
        public List<UserInPhoto> UsersInPhoto { get; set; }

        [JsonProperty("filter")]
        public string Filter { get; set; }

        [JsonProperty("tags")]
        public List<string> Tags { get; set; }

        [JsonProperty("id")]
        public string Id { get; set; }

        [JsonProperty("user")]
        public User User { get; set; }
    }

    public class Caption
    {
        [JsonProperty("id")]
        public string Id { get; set; }

        [JsonProperty("create_time")]
        public string CreateTime { get; set; }

        [JsonProperty("text")]
        public string Text { get; set; }

        [JsonProperty("from")]
        public User From { get; set; }
    }

    public class Location
    {
        [JsonProperty("id")]
        public int Id { get; set; }

        [JsonProperty("latitude")]
        public decimal Latitude { get; set; }

        [JsonProperty("longitude")]
        public decimal Longitude { get; set; }

        [JsonProperty("name")]
        public string Name { get; set; }
    }

    public class Comments
    {
        [JsonProperty("count")]
        public int Count { get; set; }

        [JsonProperty("data")]
        public List<CommentData> Data { get; set; }
    }

    public class CommentData
    {
        [JsonProperty("id")]
        public string Id { get; set; }

        [JsonProperty("created_time")]
        public int CreatedTime { get; set; }

        [JsonProperty("text")]
        public string Text { get; set; }

        [JsonProperty("from")]
        public User From { get; set; }
    }

    public class Likes
    {
        [JsonProperty("count")]
        public int Count { get; set; }

        [JsonProperty("data")]
        public List<User> Data { get; set; }
    }

    public class Images
    {
        [JsonProperty("low_resolution")]
        public Image LowResolution { get; set; }

        [JsonProperty("thumbnail")]
        public Image Thumbnail { get; set; }

        [JsonProperty("standard_resolution")]
        public Image StandardResolution { get; set; }
    }

    public class Image
    {
        [JsonProperty("url")]
        public string Url { get; set; }

        [JsonProperty("width")]
        public int Width { get; set; }

        [JsonProperty("height")]
        public int Height { get; set; }
    }

    public class UserInPhoto
    {
        [JsonProperty("position")]
        public Position Position { get; set; }

        [JsonProperty("user")]
        public User User { get; set; }
    }

    public class Position
    {
        [JsonProperty("y")]
        public decimal Y { get; set; }

        [JsonProperty("x")]
        public decimal X { get; set; }
    }
}
